package com.team.order.mapper;

import com.team.order.domain.Order;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 梁国瑞
 * @version 1.0
 */
public interface AppOrderMapper {
    int submitOrder(Order order);
    
    /**
     * 根据ID查询订单
     */
    Order selectOrderById(Long orderId);
    
    /**
     * 根据订单号查询订单
     */
    Order selectOrderByOrderNo(String orderNo);
    
    /**
     * 更新订单支付方式
     */
    int updateOrderPayType(Long orderId, Long payType);
    
    /**
     * 更新订单支付成功状态
     */
    int updateOrderPaymentSuccess(Long orderId, Long payStatus, LocalDateTime payTime, Long payType, String thirdPartyOrderNo);
    
    /**
     * 更新订单状态
     */
    int updateOrderStatus(Long orderId, String orderStatus);
    
    /**
     * 更新维修预约状态
     */
    int updateRepairReservationStatus(String verificationCode, String status);
    
    /**
     * 查询超时未支付订单
     */
    List<Order> selectTimeoutOrders(LocalDateTime timeoutTime);
}
